<?php
/**
 * login.inc.php
 */

if(!defined('IN_SITE') || !defined('IN_ADMIN'))
{
	exit('Access Denied');
}

if($_userid && $_SESSION['is_admin'] == 1) showmessage("您已经登录", "?action=default");

if($dosubmit)
{
	$member = load("member.class.php");
	$_userid = $member->login($username, $password);
	if($_userid)
	{
		$_SESSION['is_admin'] = 1;
		if($forward == '') $forward = "?action=default";
		showmessage("登录成功", $forward);
	}
	else
	{
		$_SESSION['is_admin'] = 0;
		showmessage("登录失败，用户名或密码不正确");
	}
}
else
{
	include admin_tpl('login');
}
?>